package cron

import (
	"fmt"
	"github.com/robfig/cron"
	"onerk4/zk3/common/dao/mysql"
)

func Update(orderSn string) {
	c := cron.New()
	spec := "0 */10 * * * ?"
	err := c.AddFunc(spec, func() {
		err := mysql.UpdateOrderStatus(orderSn, 4)
		if err != nil {
			return
		}
	})
	if err != nil {
		return
	}
	fmt.Println(err)
	c.Start()

	select {}
}
